#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

typedef struct TNode* PtrToTNode;
struct TNode {
    int data;
    PtrToTNode left;
    PtrToTNode right;
    int flag;
};
typedef PtrToTNode BinTree;

BinTree Insert ( BinTree BST, int X ) {
    if ( !BST ) {
        BST = (BinTree)malloc(sizeof(struct TNode));
        BST->data = X;
        BST->left = NULL;
        BST->right = NULL;
        BST->flag = 0;
    } else {
        if ( X > BST->data ) BST->right = Insert(BST->right,X);
        else if ( X < BST->data ) BST->left = Insert(BST->left,X);
    }
    return BST;
}

void free_tree ( BinTree BST ) {
    if ( BST ) {
        free_tree(BST->left);
        free(BST);
        free_tree(BST->right);
    }
}

bool check ( BinTree BST, int X ) {
    if ( !BST ) {
        printf("Empty Tree\n");
        return false;
    }
    if ( BST->data == X ) {
        if ( BST->flag == 0 ) {
            BST->flag = 1;
            return true;
        } else return false;
    }
    if ( BST->flag == 0 ) return false;
    if ( X > BST->data ) return check( BST->right, X );
    else if ( X < BST->data ) return check( BST->left, X );
}

int main () {
    int N, L, X, i, j;
    bool err = true;
    BinTree BST = NULL;
    while (1) {
        scanf("%d", &N);
        if ( N == 0 ) break;
        scanf("%d", &L);
        /* build tree */
        for ( i = 0; i < N; i++ ) {
            scanf("%d", &X);
            BST = Insert(BST,X);
        }
        /* check */
        for ( j = 0; j < L; j++ ) {
            for ( i = 0; i < N; i++ ) {
                scanf("%d", &X);
                if ( err == true ) {
                    err = check(BST,X);
                }
            }
            if ( err == true ) printf("Yes\n");
            else printf("No\n");
            err = true;
        }
        free_tree(BST);
        BST = NULL;
    }
    return 0;
}